$(function () {
    init();
    function init() {
        ajax_getcoupon()



    }
    function ajax_getcoupon() {
        $.ajax({
            type: "get",
            url: "http://193.112.55.79:9090/api/getcoupon",
            // data: "data",
            dataType: "json",
            success: function (response) {
                console.log(response);
                let html = ''
                console.log(response.result[0].couponImg);

                for (let i = 0; i < response.result.length; i++) {
                    console.log(123);

                    html += `
                    <a href="couponproduct.html?couponId=${response.result[i].couponId}"><img src="http://img12.360buyimg.com/n8/jfs/t2593/357/1469295048/230488/3cb361d4/57400d1bN011a9a73.jpg" alt="">
                    
                    <p>${response.result[i].couponTitle}</p>
                     </a>`


                }
                $('.discount').html(html);




            }
        });
    }
})